#ifndef SAFE_STDLIB_H
#define SAFE_STDLIB_H

#include <stdlib.h>

#ifndef STX_HAS_LONG_LONG
#   include <limits.h>
#   ifdef LLONG_MAX
#       define STX_HAS_LONG_LONG 1
#   else
#       define STX_HAS_LONG_LONG 0
#   endif
#endif

unsigned int abs_s(int n);

unsigned long labs_s(long n);

#if STX_HAS_LONG_LONG
unsigned long long llabs_s(long long n);
#endif

int atexit_s(void (*func)(void));

void* calloc_s(size_t num, size_t size);

void* malloc_s(size_t size);

void* realloc_s(void* ptr, size_t size);

void free_s(void* ptr);

#endif /* SAFE_STDLIB_H */
